using System.Collections;
using System.Collections.Generic;
using Unity.VisualScripting;
using UnityEngine;
using UnityEngine.UI;

public class SettingUI : UIBase
{
    [SerializeField]private Slider musicVolume;
    [SerializeField]private Slider soundVolume;


    protected override void Start()
    {
        base.Start();
        musicVolume = transform.Find("Music").GetComponent<Slider>();
        soundVolume = transform.Find("Sound").GetComponent<Slider>();
        musicVolume.value = AudioManager.Instance.MusicValue;
        soundVolume.value = AudioManager.Instance.SoundValue;
        musicVolume.onValueChanged.AddListener((value) =>
        {
            AudioManager.Instance.MusicValue = value;
        });
        soundVolume.onValueChanged.AddListener((value) =>
        {
            AudioManager.Instance.SoundValue = value;
            AudioManager.Instance.PlaySound(0);

        });
    }

}
